package com.ruoyi.emergency.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //添加
import com.ruoyi.common.utils.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.emergency.mapper.EpEscapeRouteMapper;
import com.ruoyi.emergency.domain.EpEscapeRoute;
import com.ruoyi.emergency.service.IEpEscapeRouteService;

/**
 * 避灾路线管理Service业务层处理
 * 
 * @author hcc
 * @date 2024-11-26
 */
@Service
public class EpEscapeRouteServiceImpl extends ServiceImpl<EpEscapeRouteMapper, EpEscapeRoute> implements IEpEscapeRouteService //修改
{
    @Autowired
    private EpEscapeRouteMapper epEscapeRouteMapper;

    /**
     * 查询避灾路线管理
     * 
     * @param escapeRouteId 避灾路线管理主键
     * @return 避灾路线管理
     */
    @Override
    public EpEscapeRoute selectEpEscapeRouteByEscapeRouteId(String escapeRouteId)
    {
        return epEscapeRouteMapper.selectEpEscapeRouteByEscapeRouteId(escapeRouteId);
    }

    /**
     * 查询避灾路线管理列表
     * 
     * @param epEscapeRoute 避灾路线管理
     * @return 避灾路线管理
     */
    @Override
    public List<EpEscapeRoute> selectEpEscapeRouteList(EpEscapeRoute epEscapeRoute)
    {
        return epEscapeRouteMapper.selectEpEscapeRouteList(epEscapeRoute);
    }

    /**
     * 新增避灾路线管理
     * 
     * @param epEscapeRoute 避灾路线管理
     * @return 结果
     */
    @Override
    public int insertEpEscapeRoute(EpEscapeRoute epEscapeRoute)
    {
        epEscapeRoute.setEscapeRouteId(String.valueOf(new SnowflakeIdUtils(5,8).nextId()));
        epEscapeRoute.setRouteCode(String.valueOf(new SnowflakeIdUtils(5,8).nextId()));
        return epEscapeRouteMapper.insertEpEscapeRoute(epEscapeRoute);
    }

    /**
     * 修改避灾路线管理
     * 
     * @param epEscapeRoute 避灾路线管理
     * @return 结果
     */
    @Override
    public int updateEpEscapeRoute(EpEscapeRoute epEscapeRoute)
    {
        return epEscapeRouteMapper.updateEpEscapeRoute(epEscapeRoute);
    }

    /**
     * 批量删除避灾路线管理
     * 
     * @param escapeRouteIds 需要删除的避灾路线管理主键
     * @return 结果
     */
    @Override
    public int deleteEpEscapeRouteByEscapeRouteIds(String[] escapeRouteIds)
    {
        return epEscapeRouteMapper.deleteEpEscapeRouteByEscapeRouteIds(escapeRouteIds);
    }

    /**
     * 删除避灾路线管理信息
     * 
     * @param escapeRouteId 避灾路线管理主键
     * @return 结果
     */
    @Override
    public int deleteEpEscapeRouteByEscapeRouteId(String escapeRouteId)
    {
        return epEscapeRouteMapper.deleteEpEscapeRouteByEscapeRouteId(escapeRouteId);
    }
}
